package com.bayihouse.model.vo;

import com.bayihouse.model.entity.Netobject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;


@AllArgsConstructor
@NoArgsConstructor
@Data
public class NetObjectVO implements Serializable {
    private static final long serialVersionUID = 3334407698961642442L;


    private Long id;

    /**
     * 网格名称
     */
    private String name;

    /**
     * 网格的业务,是小区,还是网点
     */
    private String detail;

    /**
     * 探针的数量
     */
    private Integer probeNum;

    /**
     *
     */
    private String createTime;

    public static NetObjectVO objToVO(Netobject netobject) {
        NetObjectVO netObjectVO = new NetObjectVO();
        BeanUtils.copyProperties(netobject,netObjectVO);
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date createTime1 = netobject.getCreateTime();
        netObjectVO.setCreateTime(simpleDateFormat.format(createTime1));
        return netObjectVO;
    }

}
